﻿# ---------------------------------------------------------------------- #
# StaticContent                                                          #
# ---------------------------------------------------------------------- #

INSERT INTO `jsc_moduletype` (`name`,`description`,`assemblyname`,`classname`,`controllername`,`viewname`) VALUES 
	('StaticContent','Module voor statische content','JSC.Portal.Web.App', 'JSC.Portal.Web.App.Modules.StaticContents.StaticContentModule', 'StaticContents', 'StaticContentView');

DROP TABLE IF EXISTS `jscm_staticcontent`;
CREATE TABLE  `jscm_staticcontent` (
  `staticcontentid` int(11) NOT NULL auto_increment,
  `sectionid` int(11) default NULL,
  `title` varchar(255) default NULL,
  `content` text NOT NULL,
  `createdby` int(11) default NULL,
  `modifiedby` int(11) default NULL,
  `createdtimestamp` datetime NOT NULL default '0000-00-00 00:00:00',
  `modifiedtimestamp` datetime default NULL,
  PRIMARY KEY  (`staticcontentid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


# ---------------------------------------------------------------------- #
# Language switcher                                                      #
# ---------------------------------------------------------------------- #
INSERT INTO `jsc_moduletype` (`name`,`description`,`assemblyname`,`classname`,`controllername`,`viewname`) VALUES 
	('LanguageSwitcher','Module voor selecteren van taal','JSC.Portal.Web.App', 'JSC.Portal.Web.App.Modules.LanguageSwitcher.LanguageSwitcherModule', 'LanguageSwitcher', 'LanguageSwitcherView');
SELECT @moduletypeid := last_insert_id();
INSERT INTO jsc_moduleproperty(Name, Description, ModuleTypeId, PropertyType, IsRequired) VALUES('DISPLAY_MODE', 'Display mode', @moduletypeid, 'JSC.Portal.Web.App.Modules.LanguageSwitcher.DisplayMode', 0);
INSERT INTO jsc_moduleproperty(Name, Description, ModuleTypeId, PropertyType, IsRequired) VALUES('REDIRECT_TO_USER_LANGUAGE', 'Redirect to user language', @moduletypeid, 'System.Boolean', 0);

# ---------------------------------------------------------------------- #
# Articles                                                               #
# ---------------------------------------------------------------------- #
DROP TABLE IF EXISTS `jscm_article`;
CREATE TABLE  `jscm_article` (
  `articleid` int(11) NOT NULL auto_increment,
  `sectionid` int(11) default NULL,
  `articlecategoryid` int(11) default NULL,
  `name` varchar(100) NOT NULL default '',
  `description` varchar(255) default NULL,
  `content` text,
  `syndicate` tinyint(1) default NULL,
  `validfrom` datetime NOT NULL default '0000-00-00 00:00:00',
  `validtill` datetime default NULL,
  `createdby` int(11) default NULL,
  `modifiedby` int(11) default NULL,
  `createdtimestamp` datetime NOT NULL default '0000-00-00 00:00:00',
  `modifiedtimestamp` datetime default NULL,
  PRIMARY KEY  (`articleid`),
  KEY `IDX_jscm_article_1` (`articlecategoryid`),
  KEY `IDX_jscm_article_2` (`sectionid`),
  KEY `IDX_jscm_article_3` (`createdby`),
  KEY `IDX_jscm_article_4` (`modifiedby`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `jscm_articlecategory`;
CREATE TABLE  `jscm_articlecategory` (
  `articlecategoryid` int(11) NOT NULL auto_increment,
  `name` varchar(100) NOT NULL default '',
  `description` varchar(255) default NULL,
  `syndicate` tinyint(1) default NULL,
  PRIMARY KEY  (`articlecategoryid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `jscm_articlecomment`;
CREATE TABLE  `jscm_articlecomment` (
  `articlecommentid` int(11) NOT NULL auto_increment,
  `articleid` int(11) NOT NULL default '0',
  `name` varchar(40) NOT NULL default '',
  `website` varchar(100) default NULL,
  `comment` text NOT NULL,
  `ipaddress` varchar(15) NOT NULL default '',
  `createdby` int(11) default NULL,
  `modifiedby` int(11) default NULL,
  `createdtimestamp` datetime NOT NULL default '0000-00-00 00:00:00',
  `modifiedtimestamp` datetime default NULL,
  PRIMARY KEY  (`articlecommentid`),
  KEY `IDX_jscm_articlecomment_1` (`articleid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `jsc_moduletype` (`name`,`description`,`assemblyname`,`classname`,`controllername`,`viewname`) VALUES 
	('Articles', 'Module voor artikelen', 'JSC.Portal.Web.App', 'JSC.Portal.Web.App.Modules.Articles.ArticleModule', 'Articles', 'ArticlesView');
SELECT @moduletypeid := last_insert_id();
INSERT INTO jsc_moduleproperty(Name, Description, ModuleTypeId, PropertyType, IsRequired) VALUES('ALLOW_COMMENTS', 'Allow comments', @moduletypeid, 'System.Boolean', 0);
INSERT INTO jsc_moduleproperty(Name, Description, ModuleTypeId, PropertyType, IsRequired) VALUES('NUMBER_OF_ARTICLES_IN_LIST', 'Number of articles to display', @moduletypeid, 'System.Int32', 1);
INSERT INTO jsc_moduleproperty(Name, Description, ModuleTypeId, PropertyType, IsRequired) VALUES('DISPLAY_TYPE', 'Display type', @moduletypeid, 'JSC.Portal.Web.App.Modules.Articles.DisplayType', 0);
INSERT INTO jsc_moduleproperty(Name, Description, ModuleTypeId, PropertyType, IsRequired) VALUES('ALLOW_ANONYMOUS_COMMENTS', 'Allow anonymous comments', @moduletypeid, 'System.Boolean', 0);
INSERT INTO jsc_moduleproperty(Name, Description, ModuleTypeId, PropertyType, IsRequired) VALUES('ALLOW_SYNDICATION', 'Allow syndication', @moduletypeid, 'System.Boolean', 0);
INSERT INTO jsc_moduleproperty(Name, Description, ModuleTypeId, PropertyType, IsRequired) VALUES('SHOW_ARCHIVE', 'Show link to archived articles', @moduletypeid, 'System.Boolean', 0);
INSERT INTO jsc_moduleproperty(Name, Description, ModuleTypeId, PropertyType, IsRequired) VALUES('SHOW_DATETIME', 'Show publish date and time', @moduletypeid, 'System.Boolean', 0);
INSERT INTO jsc_moduleproperty(Name, Description, ModuleTypeId, PropertyType, IsRequired) VALUES('SHOW_CATEGORY', 'Show category', @moduletypeid, 'System.Boolean', 0);
INSERT INTO jsc_moduleproperty(Name, Description, ModuleTypeId, PropertyType, IsRequired) VALUES('SHOW_AUTHOR', 'Show author', @moduletypeid, 'System.Boolean', 0);
INSERT INTO jsc_moduleproperty(Name, Description, ModuleTypeId, PropertyType, IsRequired) VALUES('SORT_BY', 'Sort by', @moduletypeid, 'JSC.Portal.Web.App.Modules.Articles.SortBy', 0);
INSERT INTO jsc_moduleproperty(Name, Description, ModuleTypeId, PropertyType, IsRequired) VALUES('SORT_DIRECTION', 'Sort direction', @moduletypeid, 'System.Web.UI.WebControls.SortDirection, System.Web', 0);

# ---------------------------------------------------------------------- #
# ContactUs                                                              #
# ---------------------------------------------------------------------- #
INSERT INTO `jsc_moduletype` (`name`,`description`,`assemblyname`,`classname`,`controllername`,`viewname`) VALUES 
	('ContactUs','Module voor opnemen van contact','JSC.Portal.Web.App', 'JSC.Portal.Web.App.Modules.ContactUs.ContactUsModule', 'ContactUs', 'ContactUsView');

DROP TABLE IF EXISTS `jscm_contact`;
CREATE TABLE  `jscm_contact` (
  `contactid` int(10) unsigned NOT NULL auto_increment,
  `sectionid` int(11) default NULL,
  `name` varchar(100) NOT NULL default '',
  `subject` varchar(255) default NULL,
  `title` varchar(100) NOT NULL default '',
  `email` varchar(255) NOT NULL default '',
  `phonenumber` varchar(45) default NULL,
  `message` text,
  `moment` datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  (`contactid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;